Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add workflow tab in export #393

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

islxyqwe
Copy link
Member

Added a workflow tab to show workflow of current chart.
image

Copy link

vercel bot commented Jun 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphic-walker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2024 3:12am

Copy link
Contributor

github-actions bot commented Jun 19, 2024

Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/components/codeExport/index.tsx

  1. The syntaxHighlight function is doing a lot of string replacements which could be inefficient for large strings. Consider using a library for syntax highlighting if possible, as it would be more efficient and safer.

  2. The useEffect hook is doing a lot of conditional checks for tabKey. Consider using a switch statement instead of multiple if-else statements for better readability.

  3. The console.error('unknown tabKey') statement could be improved by including the value of the tabKey in the error message for better debugging.

Example:

useEffect(() => {
  if (showCodeExportPanel) {
    switch(tabKey) {
      case 'graphic-walker':
        setCode(vizStore.exportCode());
        break;
      case 'vega-lite':
        setCode(vizStore.lastSpec);
        break;
      case 'workflow':
        setCode(vizStore.workflow);
        break;
      default:
        console.error(`unknown tabKey: ${tabKey}`);
    }
  }
}, [tabKey, showCodeExportPanel, vizStore]);
  1. The dangerouslySetInnerHTML prop is used which can open up the possibility for Cross-Site Scripting (XSS) attacks. Make sure the content being set is properly sanitized.

📚🔄🔒


Powered by Code Review GPT

@ObservedObserver ObservedObserver merged commit a02af90 into main Jun 19, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants